import axios from '@/libs/api.request'

export const login = ({ userName, password }) => {
  const data = {
    userName,
    password
  }
  return axios.request({
    url: 'sysUser/loginAction',
    data,
    method: 'post'
  })
}

// export const getUserInfo = (token) => {
//   return axios.request({
//     url: 'get_info',
//     params: {
//       token
//     },
//     method: 'get'
//   })
// }

export const logout = (data) => {
  return axios.request({
    url: 'sysUser/logOutAction',
    method: 'post',
    data
  })
}
export const sengMsg = (data) => {
  return axios.request({
    url: 'sysUser/sengMsg',
    method: 'post',
    data
  })
}
//发送注册验证码
export const sendRegisterCode = (data) => {
  return axios.request({
    url: 'sysUser/sendRegisterCode',
    method: 'post',
    data
  })
}
//注册账号
export const registerAccount = (data) => {
  return axios.request({
    url: 'sysUser/registerAccount',
    method: 'post',
    data
  })
}
//发送找回的验证码
export const sendBackCode = (data) => {
  return axios.request({
    url: 'sysUser/sendBackCode',
    method: 'post',
    data
  })
}
//找回密码
export const backPassword = (data) => {
  return axios.request({
    url: 'sysUser/backPassword',
    method: 'post',
    data
  })
}

